home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / cmln0785.arc / EXOTIC.LTG < prev    next >
Text File  |  1986-02-27  |  2KB  |  64 lines

  1.  
  2.             Exotic Language of the Month -- July 1985
  3.                           MRS Language
  4.  
  5.                             Listing 1
  6.  
  7. (assert '(template (&x &y) (&y is &x)))
  8. (assert '(template (hobbit &y) (&y is a hobbit)))
  9. (assert '(template (orc &y) (&y is a orc)))
  10. (assert '(template (age &x &y) (&x is &y years old)))
  11. (defun find (x) (output (plug x (truep x))))
  12.  
  13.  
  14.                             Listing 2
  15.  
  16. (assert '(if (ugly $x) (nasty $x ugly)))
  17. (assert '(if (mean $x) (nasty $x mean)))
  18. (assert '(template (nasty &x &y)(&x is nasty because he is &y)
  19. (setq preferred t)
  20. (assert '(preferred (bcdisp ((ugly &x)).l)
  21.               (bcdisp ((mean &y)). &m)))
  22. (find '(nasty $x $y))
  23.  
  24. ragashaδ i≤ nast∙ becausσ hσ i≤ ugly
  25.  
  26.  
  27.                             Listing 3
  28.  
  29. (goal-state  {statedescription})
  30. (illegal-state {statedescription})
  31. (possible-operator operator-n {statedescription} {newstatedescription} )
  32. (if (or (goal-state {statedescription})
  33.         (and (unprovable (illegal-state {statedescription}))
  34.              (possible-operator $operator {statedes} {newstatedes} )
  35.              (hobbits-orcs $ops {newstatedes})))
  36.      (hobbits-orcs ($operator . $ops) {statedescription} ))
  37.  
  38.  
  39.                             Listing 4
  40.  
  41. (onside state-0 north orcs ragashak)
  42. (onside state-0 north numberoforcs 2)
  43. (onside state-0 south numberoforcs 0)
  44. (onside state-0 north hobbits Bilbo)....
  45.  
  46.    (if (and (onside $state south numberoforcs 2)
  47.             (onside $state south numberofhobbits 2))
  48.        (goal $state))
  49.  
  50.    (if (and (onside $state $anyside numberoforcs $norcs)
  51.             (onside $state $anyside numberofhobbits $nhobbits)
  52.             (> $norcs $nhobbits))
  53.        (illegal-state $state))
  54.  
  55. è                            Listing 5
  56.  
  57. (tolookup (onside &state &side &type &value) strips)
  58.  
  59. (defun strips
  60.    (state side type value)
  61.    (or (lookup `(onside-g ,state ,side ,type ,value))
  62.        (strips (lookupbdg '$nextstate `($nextstate ,state '$nextstate))
  63.                side type value)))
  64.